<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVoucherReceiveTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('voucher_receive', function (Blueprint $table) {
            $table->increments('id');
            $table->string('sn',60);//优惠劵编号
            $table->integer('voucher_id');//优惠劵ID
            $table->integer('user_id');//优惠劵领用人
            $table->integer('staff_uuid');//创建人
            $table->timestamp('receive_time')->nullable();//领用时间
            $table->timestamp('past_time')->nullable();//过期时间
            $table->boolean('is_use')->default(false);//是否被使用;
            $table->boolean('available')->default(true);//是否启用
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('voucher_receive');
    }
}
